<template>
	<view>
		<cu-custom bgColor="bg-theme" :isBack="!izShare">
			<block slot="backText" v-if="!izShare">返回</block>
			<block slot="content">{{title}}</block>
		</cu-custom>
		<scroll-view class="bg-img" style="width: 100%;">
			<view class="bg-white round Gohome" @tap="GoMore" v-if="izShare">
				查看更多
			</view>
			<image :src="item.img" mode="scaleToFill" v-for="(item,index) in showList" :key="index" style="width: 100%; height:100vh;"></image>
		</scroll-view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				title:'',
				showList:[],
				izShare:false,//是否为分享进入
				brandList:[
					{img:'http://lianjiu.oss-cn-hangzhou.aliyuncs.com/productImagesother/E35A9D66EA28461F8FC3B4530FC03D9B.jpeg'},
					{img:'http://lianjiu.oss-cn-hangzhou.aliyuncs.com/productImagesother/C7B4A366111C473AB3EDE97CB0AA0061.jpeg'},
					{img:'http://lianjiu.oss-cn-hangzhou.aliyuncs.com/productImagesother/8ACDCB65B5924E8C8E83216C9F522969.jpeg'},
					{img:'http://lianjiu.oss-cn-hangzhou.aliyuncs.com/productImagesother/8ACDCB65B5924E8C8E83216C9F522969.jpeg'},
					{img:'http://lianjiu.oss-cn-hangzhou.aliyuncs.com/productImagesother/175C287B204C4870BBEB5894D5B69CC5.jpeg'},
					{img:'http://lianjiu.oss-cn-hangzhou.aliyuncs.com/productImagesother/12D1629E7A4C484C836650E9DD927E05.jpeg'},
					{img:'http://lianjiu.oss-cn-hangzhou.aliyuncs.com/productImagesother/F5744001C30D44D6B60E71D662BCB6FA.jpeg'},
					{img:'http://lianjiu.oss-cn-hangzhou.aliyuncs.com/productImagesother/F10B2D4DDD3C46DAA7C5C6964509EB32.jpeg'}
				],
				skinList:[
					{img:'http://lianjiu.oss-cn-hangzhou.aliyuncs.com/productImagesother/8F0B7A50878D4565ADCB955595B4F1B9.jpeg'},
					{img:'http://lianjiu.oss-cn-hangzhou.aliyuncs.com/productImagesother/C4A5A5FC7130426DB7EA39BC66996CC3.jpeg'},
					{img:'http://lianjiu.oss-cn-hangzhou.aliyuncs.com/productImagesother/B05A0F9BB5F24E739FF4EFF25E04DBB9.jpeg'},
					{img:'http://lianjiu.oss-cn-hangzhou.aliyuncs.com/productImagesother/B74692E63C1A4F5DA15E7456EBE3F16E.jpeg'},
					{img:'http://lianjiu.oss-cn-hangzhou.aliyuncs.com/productImagesother/C6950B06CCFC4CF7BC46B9E452AE5C40.jpeg'},
					{img:'http://lianjiu.oss-cn-hangzhou.aliyuncs.com/productImagesother/F32B9ED0C3C8490A87E872D5C75C43D4.jpeg'},
					{img:'http://lianjiu.oss-cn-hangzhou.aliyuncs.com/productImagesother/85891B92EB524B6EB83E47017BD48153.jpeg'},
					{img:'http://lianjiu.oss-cn-hangzhou.aliyuncs.com/productImagesother/5F2D97E202D54D42835A0909204738C1.jpeg'}
				],
				moudelList:[
					{img:'http://lianjiu.oss-cn-hangzhou.aliyuncs.com/productImagesother/52EA66F6F87944D0AB537C91A3F2240D.jpeg'},
					{img:'http://lianjiu.oss-cn-hangzhou.aliyuncs.com/productImagesother/D8A5A8C90D8D4A1C9ED7748429DCA450.jpeg'},
					{img:'http://lianjiu.oss-cn-hangzhou.aliyuncs.com/productImagesother/870F803ED72147D98FE33115DECC36E4.jpeg'},
					{img:'http://lianjiu.oss-cn-hangzhou.aliyuncs.com/productImagesgoods/1C9B4A5311894DF191511F96DE004A4D.jpeg'},
					{img:'http://lianjiu.oss-cn-hangzhou.aliyuncs.com/productImagesother/EFE5870766DD42458BEBCF6DB0CD2763.jpeg'},
					{img:'http://lianjiu.oss-cn-hangzhou.aliyuncs.com/productImagesother/52554AB0CDDB4E4BAD5AC0934FA57858.jpeg'},
				],
				timeList:[
					{img:'http://lianjiu.oss-cn-hangzhou.aliyuncs.com/productImagesother/E4604C8D44FC404B8965F40EF1CE0B0C.jpeg'},
					{img:'http://lianjiu.oss-cn-hangzhou.aliyuncs.com/productImagesother/050C8590CAE94F65A01BEC2C189DBF30.jpeg'},
					{img:'http://lianjiu.oss-cn-hangzhou.aliyuncs.com/productImagesother/B6478A5D96914C8FAF9D75FF5092A570.jpeg'},
				],
				afterSaleList:[
					{img:'http://lianjiu.oss-cn-hangzhou.aliyuncs.com/productImagesother/D5569FCEB8EC4D65BF52D822EEAFEEB6.jpeg'},
					{img:'http://lianjiu.oss-cn-hangzhou.aliyuncs.com/productImagesother/CA5D4C12D22A4B86B9E9060DF4882510.jpeg'},
					{img:'http://lianjiu.oss-cn-hangzhou.aliyuncs.com/productImagesother/5BA409A4EA874332A68764118F72D3A1.jpeg'},
					{img:'http://lianjiu.oss-cn-hangzhou.aliyuncs.com/productImagesother/E8E4CE7B633E48EC962BE37C06377750.jpeg'},
					{img:'http://lianjiu.oss-cn-hangzhou.aliyuncs.com/productImagesother/2388EFA4B71048CE9480B4B7CE70B68F.jpeg'},
					{img:'http://lianjiu.oss-cn-hangzhou.aliyuncs.com/productImagesother/BD5771E280A54081A9567A3B9A63A75C.jpeg'},
					{img:'http://lianjiu.oss-cn-hangzhou.aliyuncs.com/productImagesother/F450000F7D724431B374680920EC1688.jpeg'},
					{img:'http://lianjiu.oss-cn-hangzhou.aliyuncs.com/productImagesother/1027FAC1372142A583C9389C3CFB3CBB.jpeg'},
					{img:'http://lianjiu.oss-cn-hangzhou.aliyuncs.com/productImagesother/41E3B0F0E13047FCA092D76B3E15874D.jpeg'}					
				],
				natureList:[
					{img:'http://lianjiu.oss-cn-hangzhou.aliyuncs.com/productImagesother/EB2F8A766D7B4F99B171104580F99AC7.jpeg'},
					{img:'http://lianjiu.oss-cn-hangzhou.aliyuncs.com/productImagesother/1C45BBAB21B04FA18736DC7C134BC769.jpeg'},
					{img:'http://lianjiu.oss-cn-hangzhou.aliyuncs.com/productImagesother/03EA5FF2DCCD449386A0C00F527C6C73.jpeg'},
					{img:'http://lianjiu.oss-cn-hangzhou.aliyuncs.com/productImagesother/5C0C6C760B194A8BB63080DEE60A08F5.jpeg'},
					{img:'http://lianjiu.oss-cn-hangzhou.aliyuncs.com/productImagesother/C3D1E5B12D934A4EAD767CB79AA21D76.jpeg'},
					{img:'http://lianjiu.oss-cn-hangzhou.aliyuncs.com/productImagesother/2E8F501B11334AE2A5661345EF3D9C7B.jpeg'},
					{img:'http://lianjiu.oss-cn-hangzhou.aliyuncs.com/productImagesother/3F083F61ADC84CEF9E863A8D66F70CD5.jpeg'},
				]
			}
		},
		onLoad(e) {
			this.title = e.name
			if(e.type && e.type=='share'){
				this.izShare = true
			}
			if(e.shareUser){
				let shop = uni.getStorageSync('shop') || {}
				shop.shareU = e.shareUser
				uni.setStorageSync('shop',shop)
				uni.setStorageSync('shareUser',{'shareU':e.shareUser})
			}
			if(e.shop_name){
				let shop = uni.getStorageSync('shop') || {}
				shop.shop_name = e.shop_name
				uni.setStorageSync('shop',shop)
			}
			if(e.phone){
				uni.setStorageSync('referrer', e.phone)
			}
		},
		onShow() {
			switch(this.title){
				case '科学护肤':
				this.showList = this.skinList
				return
				case '品牌介绍':
				this.showList = this.brandList
				return 
				case '时光喷雾':
				this.showList = this.timeList
				return 
				case '零添加':
				this.showList = this.natureList
				return 
				case '商业模式':
				this.showList = this.moudelList
				return 
				case '售后服务':
				this.showList = this.afterSaleList
				return 
			}
		},
		methods:{
			onShareAppMessage() {
				let role_id = uni.getStorageSync('role').id
				let user = uni.getStorageSync('userInfo').nickname
				let phone = uni.getStorageSync('userInfo').mobile
				let shop_name = uni.getStorageSync('shop').shop_name
				let title = ''
				let path = ''
				if(role_id){
					title = user +'的' +shop_name+',快进来看看吧'
					path = 'pages/introduce/detail?type=share&name=' + this.title+'&shareUser='+user+'&shop_name='+shop_name+'&phone='+phone
				}else{
					title = shop_name+'欢迎您的光临'
					path = 'pages/introduce/detail?type=share&name=' + this.title
				}
			    return {
					title: title,
					path: path
			    }
			},
			GoMore(){
				uni.reLaunch({
					url:'/pages/introduce/index'
				})
			}
		}
	}
</script>

<style lang="scss">
.Gohome{
	position: fixed;
	background: #fff;
	bottom: 100rpx;
	right: 40rpx;
	border-radius: 100%;
	border: 1px solid #eee;
	z-index: 9999;
	width: 120rpx;
	height: 120rpx;
	display: flex;
	justify-content: center;
	align-items: center;
	overflow: hidden;
	padding: 30rpx;

}
</style>
